home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
animatin
/
anim_q2z
/
symetry
/
wsym.lst
< prev
next >
Wrap
File List
|
1995-04-26
|
4KB
|
175 lines
'
' symetry
'
~WIND_GET(0,4,x&,y&,wid&,hei&)
ncol&=WORK_OUT(13)
rez&=XBIOS(4)
DIM x1&(512),y1&(512),x2&(512),y2&(512),msg&(7)
~FRE(0)
'
'
'
hand&=WIND_CREATE(&X101111,x&,y&,wid&,hei&)
title$=" Symetry "+CHR$(0)
t%=V:title$
~WIND_SET(hand&,2,CARD(SWAP(t%)),CARD(t%),0,0)
~WIND_OPEN(hand&,x&,y&,wid&,hei&)
~WIND_GET(hand&,4,wx&,wy&,ww&,wh&)
~FORM_DIAL(3,0,0,0,0,wx&,wy&,ww&,wh&)
'
'
LET quit!=FALSE
@r
clr&=RANDOM(ncol&-2)+2
COLOR clr&
'
DO
e&=EVNT_MULTI(&X110000,0,0,0,0,0,0,0,0,0,0,0,0,0,V:msg&(0),2)
IF e& AND &X10000
SELECT msg&(0)
CASE 20
@redraw
CASE 22
LET quit!=TRUE
CASE 23
@big
CASE 27
@size
CASE 28
@move
ENDSELECT
ENDIF
EXIT IF quit!=TRUE
'
' do the lines stuff here
'
GRAPHMODE 1
COLOR clr&
LINE x1&+wx&,y1&+wy&,x2&+wx&,y2&+wy&
LINE mx&-(x1&+wx&),y1&+wy&,mx&-(x2&+wx&),y2&+wy&
LINE mx&-(x1&+wx&),my&-y1&,mx&-(x2&+wx&),my&-y2&
LINE x1&+wx&,my&-y1&,(x2&+wx&),my&-y2&
IF turn.on!
GRAPHMODE 1
COLOR 1
x1a&=x1&(a% MOD 256)
x2a&=x2&(a% MOD 256)
y1a&=y1&(a% MOD 256)
y2a&=y2&(a% MOD 256)
LINE x1&(a% MOD 256)+wx&,y1&(a% MOD 256)+wy&,x2&(a% MOD 256)+wx&,y2&(a% MOD 256)+wy&
LINE mx&-(x1a&+wx&),y1a&+wy&,mx&-(x2a&+wx&),y2a&+wy&
LINE mx&-(x1a&+wx&),my&-y1a&,mx&-(x2a&+wx&),my&-y2a&
LINE x1a&+wx&,my&-y1a&,x2a&+wx&,my&-y2a&
GRAPHMODE 1
COLOR clr&
ENDIF
'
'
x1&(a% MOD 256)=x1&
y1&(a% MOD 256)=y1&
x2&(a% MOD 256)=x2&
y2&(a% MOD 256)=y2&
'
IF xdif1&+x1&+wx&>mx& OR xdif1&+x1&<0
xdif1&=-xdif1&
ENDIF
IF xdif2&+x2&+wx&>mx& OR xdif2&+x2&<0
xdif2&=-xdif2&
ENDIF
IF ydif1&+y1&+wy&>=my& OR ydif1&+y1&<0
ydif1&=-ydif1&
ENDIF
IF ydif2&+y2&+wy&>my& OR ydif2&+y2&<0
ydif2&=-ydif2&
ENDIF
ADD x1&,xdif1&
ADD x2&,xdif2&
ADD y1&,ydif1&
ADD y2&,ydif2&
INC a%
IF a%>254
turn.on!=TRUE
color.test:
IF ncol&>2
oclr&=clr&
REPEAT
clr&=RANDOM(ncol&)
UNTIL clr&<>oclr&
ENDIF
' IF clr&=1
' GOTO color.test
' ENDIF
COLOR clr&
CLR a%
@r1
ENDIF
LOOP
~WIND_CLOSE(hand&)
~WIND_DELETE(hand&)
'
'
PROCEDURE redraw
~WIND_GET(hand&,4,wx&,wy&,ww&,wh&)
BOUNDARY 0
DEFFILL 1,2,8
PBOX wx&,wy&,wx&+ww&-1,wy&+wh&-1
CLR a%
@r
my&=wy&+wh&
mx&=wx&+ww&
turn.on!=FALSE
RETURN
'
PROCEDURE r
x1&=RANDOM(ww&)
x2&=RANDOM(ww&)
y1&=RANDOM(wh&)
y2&=RANDOM(wh&)
@r1
RETURN
'
PROCEDURE r1
xdif1&=RANDOM(6)+1
xdif2&=RANDOM(3)+1
ydif1&=RANDOM(5)+1
ydif2&=RANDOM(3)+1
RETURN
'
PROCEDURE big
IF big!
~WIND_CALC(0,&X101111,oldx&,oldy&,oldw&,oldh&,ox&,oy&,ow&,oh&)
~WIND_SET(hand&,5,ox&,oy&,ow&,oh&)
~WIND_CALC(1,&X101111,ox&,oy&,ow&,oh&,ox&,oy&,ow&,oh&)
CLIP ox&,oy&,ow&,oh&
~FORM_DIAL(3,0,0,0,0,x&,y&,wid&,hei&)
ELSE
oldx&=wx&
oldy&=wy&
oldw&=ww&
oldh&=wh&
~WIND_SET(hand&,5,x&,y&,wid&,hei&)
CLIP x&,y&,wid&,hei&
~FORM_DIAL(3,0,0,0,0,x&,y&,wid&,hei&)
ENDIF
big!=NOT big!
RETURN
'
PROCEDURE move
CLIP msg&(4),msg&(5),msg&(6),msg&(7)
~WIND_SET(msg&(3),5,msg&(4),msg&(5),msg&(6),msg&(7))
~FORM_DIAL(3,0,0,0,0,x&,y&,wid&,hei&)
RETURN
'
'
PROCEDURE size
sx&=msg&(4)
sy&=msg&(5)
sw&=msg&(6)
sh&=msg&(7)
~WIND_CALC(1,&X101111,msg&(4),msg&(5),msg&(6),msg&(7),c1&,c2&,c3&,c4&)
CLIP c1&,c2&,c3&,c4&
~WIND_SET(hand&,5,sx&,sy&,sw&,sh&)
big!=FALSE
~FORM_DIAL(3,0,0,0,0,x&,y&,wid&,hei&)
RETURN